class CreateCashFlowStatements < ActiveRecord::Migration
  def self.up
    create_table :cash_flow_statements do |t|
      t.string :stock_no
      t.string :report_date #=>报告期
      t.decimal :selling_cash, :precision => 20, :scale => 2 #=>销售商品、提供劳务收到的现金
      t.decimal :rent_cash, :precision => 20, :scale => 2 #=>收取的租金
      t.decimal :value_added_and_refunded_tax, :precision => 20, :scale => 2 #=>收到的增值税销项税额和退回的税款
      t.decimal :other_returned_tax, :precision => 20, :scale => 2 #=>收到的除增值税以外的其他税费返还
      t.decimal :operating_activities_related_cash, :precision => 20, :scale => 2 #=>收到的其他与经营活动有关的现金
      t.decimal :operating_activities_related_cash_inflow_subtotal, :precision => 20, :scale => 2 #=>经营活动现金流入小计
      t.decimal :purchase_goods_or_services_paid, :precision => 20, :scale => 2 #=>购买商品接受劳务支付的现金
      t.decimal :operating_lease_paid, :precision => 20, :scale => 2 #=>经营租赁所支付的现金
      t.decimal :employees_paid, :precision => 20, :scale => 2 #=>支付给职工以及为职工支付的现金
      t.decimal :vat_paid_tax, :precision => 20, :scale => 2 #=>支付的增值税款
      t.decimal :income_tax, :precision => 20, :scale => 2 #=>支付的所得税款
      t.decimal :other_tax, :precision => 20, :scale => 2 #=>支付的除增值税所得税以外的税费
      t.decimal :tax_subtotal, :precision => 20, :scale => 2 #=>支付的各项税费
      t.decimal :other_operating_activities_related_paid, :precision => 20, :scale => 2 #=>支付的其他与经营活动有关的现金
      t.decimal :operating_activities_cash_outflow_subtotal, :precision => 20, :scale => 2 #=>经营活动现金流出小计
      t.decimal :operating_activities_generated_net_cash_flow, :precision => 20, :scale => 2 #=>经营活动产生的现金流量净额
      t.decimal :recovery_of_investment_cash, :precision => 20, :scale => 2 #=>收回投资所收到的现金
      t.decimal :investment_income_cash, :precision => 20, :scale => 2 #=>取得投资收益所收到的现金
      t.decimal :dividends_or_profits_cash, :precision => 20, :scale => 2 #=>分得股利或利润所收到的现金
      t.decimal :bond_interest_income_cash, :precision => 20, :scale => 2 #=>取得债券利息收入所收到的现金
      t.decimal :long_term_assets_recovery_cash, :precision => 20, :scale => 2 #=>处置固定无形和长期资产收回的现金
      t.decimal :other_investment_activities_related_cash, :precision => 20, :scale => 2 #=>收到的其他与投资活动有关的现金
      t.decimal :investing_activities_cash_inflow_subtotal, :precision => 20, :scale => 2 #=>投资活动现金流入小计
      t.decimal :building_long_term_assets_paid, :precision => 20, :scale => 2 #=>购建固定无形和长期资产支付的现金
      t.decimal :equity_investment_paid, :precision => 20, :scale => 2 #=>权益性投资所支付的现金
      t.decimal :investment_claims_paid, :precision => 20, :scale => 2 #=>债权性投资所支付的现金
      t.decimal :investment_paid, :precision => 20, :scale => 2 #=>投资所支付的现金
      t.decimal :other_investment_related_activities_paid, :precision => 20, :scale => 2 #=>支付的其他与投资活动有关的现金
      t.decimal :investing_activities_cash_outflow_subtotal, :precision => 20, :scale => 2 #=>投资活动现金流出小计
      t.decimal :investment_activities_generated_net_cash_flow, :precision => 20, :scale => 2 #=>投资活动产生的现金流量净额
      t.decimal :absorption_of_investment_received_cash, :precision => 20, :scale => 2 #=>吸收权益性投资所收到的现金
      t.decimal :issuing_bonds_received_cash, :precision => 20, :scale => 2 #=>发行债券所收到的现金
      t.decimal :borrowers_received_cash, :precision => 20, :scale => 2 #=>借款所收到的现金
      t.decimal :other_financing_activities_related_received_cash, :precision => 20, :scale => 2 #=>收到的其他与筹资活动有关的现金
      t.decimal :financing_cash_inflow_subtotal, :precision => 20, :scale => 2 #=>筹资活动现金流入小计
      t.decimal :debt_paid, :precision => 20, :scale => 2 #=>偿还债务所支付的现金
      t.decimal :financing_costs_paid, :precision => 20, :scale => 2 #=>发生筹资费用所支付的现金
      t.decimal :dividends_or_profits_distribution_paid, :precision => 20, :scale => 2 #=>分配股利或利润所支付的现金
      t.decimal :interest_paid, :precision => 20, :scale => 2 #=>偿付利息所支付的现金
      t.decimal :finance_leases_paid, :precision => 20, :scale => 2 #=>融资租赁所支付的现金
      t.decimal :registered_capital_reducing_paid, :precision => 20, :scale => 2 #=>减少注册资本所支付的现金
      t.decimal :other_financing_activities_related_paid, :precision => 20, :scale => 2 #=>支付的其他与筹资活动有关的现金
      t.decimal :financing_activities_cash_outflow_subtotal, :precision => 20, :scale => 2 #=>筹资活动现金流出小计
      t.decimal :financing_activities_generated_net_cash_flow, :precision => 20, :scale => 2 #=>筹资活动产生的现金流量净额
      t.decimal :exchange_rate_impact_cash, :precision => 20, :scale => 2 #=>汇率变动对现金的影响
      t.decimal :cash_and_cash_equivalents_net_increase, :precision => 20, :scale => 2 #=>现金及现金等价物净增加额
      t.decimal :pay_debt_using_fixed_assets, :precision => 20, :scale => 2 #=>以固定资产偿还债务
      t.decimal :long_term_investment_using_fixed_assets, :precision => 20, :scale => 2 #=>以固定资产进行长期投资
      t.decimal :pay_debt_using_invest, :precision => 20, :scale => 2 #=>以投资偿还债务
      t.decimal :finance_leases_of_fixed_assets, :precision => 20, :scale => 2 #=>融资租赁固定资产
      t.decimal :pay_debt_using_inventory, :precision => 20, :scale => 2 #=>以存货偿还债务
      t.decimal :net_income, :precision => 20, :scale => 2 #=>净利润
      t.decimal :minority_gains_and_losses, :precision => 20, :scale => 2 #=>少数股东损益
      t.decimal :assets_impairment_provision, :precision => 20, :scale => 2 #=>计提的资产减值准备
      t.decimal :bad_debt_provision, :precision => 20, :scale => 2 #=>计提的坏帐准备或转销的坏帐
      t.decimal :fixed_assets_depreciation, :precision => 20, :scale => 2 #=>固定资产折旧
      t.decimal :intangible_assets_amortization, :precision => 20, :scale => 2 #=>无形资产摊销
      t.decimal :deferred_assets_amortization, :precision => 20, :scale => 2 #=>递延资产摊销
      t.decimal :long_term_prepaid_expenses_amortization, :precision => 20, :scale => 2 #=>长期待摊费用摊销
      t.decimal :deferred_expenses_reduction, :precision => 20, :scale => 2 #=>待摊费用的减少(减增加)
      t.decimal :accrued_expenses_increase, :precision => 20, :scale => 2 #=>预提费用的增加(减减少)
      t.decimal :intangible_fixed_and_long_term_assets_disposal_losses, :precision => 20, :scale => 2 #=>处置固定无形和其他长期资产的损失(减：收益)
      t.decimal :fixed_assets_end_of_life_losses, :precision => 20, :scale => 2 #=>固定资产报废损失
      t.decimal :finance_charges, :precision => 20, :scale => 2 #=>财务费用
      t.decimal :investment_losses, :precision => 20, :scale => 2 #=>投资损失(减收益)
      t.decimal :deferred_tax_credit, :precision => 20, :scale => 2 #=>递延税款贷项(减借项)
      t.decimal :inventory_reduction, :precision => 20, :scale => 2 #=>存货的减少(减增加)
      t.decimal :operating_receivables_reduction, :precision => 20, :scale => 2 #=>经营性应收项目的减少(减增加)
      t.decimal :operating_payables_increase, :precision => 20, :scale => 2 #=>经营性应付项目的增加(减减少)
      t.decimal :value_added_tax_net_increase, :precision => 20, :scale => 2 #=>增值税增加净额(减减少)
      t.decimal :other_cash_flow, :precision => 20, :scale => 2 #=>其他
      t.decimal :funds_end_balance, :precision => 20, :scale => 2 #=>货币资金的期末余额
      t.decimal :funds_opening_balance, :precision => 20, :scale => 2 #=>货币资金的期初余额
      t.decimal :cash_equivalents_end_balance, :precision => 20, :scale => 2 #=>现金等价物的期末余额
      t.decimal :cash_equivalents_opening_balance, :precision => 20, :scale => 2 #=>现金等价物的期初余额
      t.decimal :subsidiary_minority_shareholders_investment_cash, :precision => 20, :scale => 2 #=>子公司吸收少数股东权益性投资所收到的现金
      t.decimal :subsidiary_minority_shareholders_profits_paid, :precision => 20, :scale => 2 #=>子公司支付给少数股东的利润
      t.decimal :unrecognized_investment_losses, :precision => 20, :scale => 2 #=>未确认投资损失
      t.decimal :inventory_loss_provision, :precision => 20, :scale => 2 #=>计提的存货跌价损失准备
      t.decimal :fixed_assets_impairment_provision, :precision => 20, :scale => 2 #=>计提的固定资产减值准备
      t.decimal :intangible_assets_impairment_provision, :precision => 20, :scale => 2 #=>计提的无形资产减值准备
      t.decimal :interest_and_investment_income, :precision => 20, :scale => 2 #=>利息及投资收入
      t.decimal :borrow_difference_amortization, :precision => 20, :scale => 2 #=>合并借差(减:贷差)摊销
      t.decimal :day_before_buy_net_profit, :precision => 20, :scale => 2 #=>购买日前净利润
      t.decimal :other_long_term_debt_amortization, :precision => 20, :scale => 2 #=>其他长期负债摊销
      t.decimal :fixed_assets_value_added_part_depreciation, :precision => 20, :scale => 2 #=>冲转固定资产评估增值部分的折旧
      t.decimal :start_up_costs_amortization, :precision => 20, :scale => 2 #=>开办费摊销
      t.timestamps
    end
  end

  def self.down
    drop_table :cash_flow_statements
  end
end
